package com.warm.pump.module.work.dao.gen;

import java.util.List;
import java.util.Map;
import java.util.Date;
import java.math.BigDecimal;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import com.warm.pump.frame.gen.bean.PageBean;
import com.warm.pump.frame.gen.util.TypeCast;
import com.warm.pump.frame.gen.exception.ServiceException;
import com.warm.pump.module.work.bean.po.gen.WorkDb;
import com.warm.pump.module.work.mapper.gen.WorkDbMapper;
import com.warm.pump.module.work.bean.po.gen.WorkDbExample;

@Repository
public class WorkDbDao {
    // 日志对象
    private transient Log log = LogFactory.getLog(this.getClass());
    @Autowired
    private WorkDbMapper workDbMapper;

    // 增加一个后台WorkDb表

    public boolean insert(WorkDb workDb) {
        try {
            workDbMapper.insert(workDb);
            log.debug("后台WorkDb表增加成功");
            return true;
        } catch (Exception e) {
            log.debug("后台WorkDb表增加失败");
            throw new ServiceException("后台WorkDb表增加失败", e);
        }
    }
    // 增加一个后台WorkDb表Selective

    public boolean insertSelective(WorkDb workDb) {
        try {
            workDbMapper.insertSelective(workDb);
            log.debug("后台WorkDb表增加成功");
            return true;
        } catch (Exception e) {
            log.debug("后台WorkDb表增加失败");
            throw new ServiceException("后台WorkDb表增加失败", e);
        }
    }

    // 删除一个后台WorkDb表

    public boolean deleteByPrimaryKey(Long id) {
        try {
            workDbMapper.deleteByPrimaryKey(id);
            log.debug("后台WorkDb表删除成功");
            return true;
        } catch (Exception e) {
            log.debug("后台WorkDb表删除失败");
            throw new ServiceException("后台WorkDb表删除失败", e);
        }
    }
    // 删除一个后台WorkDb表byMap

    public boolean deleteByMap(Map workDbMap) {
        try {
            workDbMapper.deleteByExample(createWorkDbExample(workDbMap, null, null));
            log.debug("后台WorkDb根据Map删除成功");
            return true;
        } catch (Exception e) {
            log.debug("后台WorkDb根据GroupID删除失败");
            throw new ServiceException("后台WorkDb根据object删除失败", e);
        }
    }
    // 修改一个后台WorkDb表

    public boolean updateByPrimaryKey(WorkDb workDb) {
        try {
            workDbMapper.updateByPrimaryKey(workDb);
            log.debug("后台WorkDb表修改成功");
            return true;
        } catch (Exception e) {
            log.debug("后台WorkDb表修改失败");
            throw new ServiceException("后台WorkDb表修改失败", e);
        }
    }
    // 修改一个后台WorkDb表Selective

    public boolean updateByPrimaryKeySelective(WorkDb workDb) {
        try {
            workDbMapper.updateByPrimaryKeySelective(workDb);
            log.debug("后台WorkDb表修改成功");
            return true;
        } catch (Exception e) {
            log.debug("后台WorkDb表修改失败");
            throw new ServiceException("后台WorkDb表修改失败", e);
        }
    }
    // 修改一个后台WorkDb表

    public boolean updateByMap(WorkDb workDb, Map workDbMap) {
        try {
            workDbMapper.updateByExample(workDb, createWorkDbExample(workDbMap, null, null));
            log.debug("后台批量WorkDb表修改成功");
            return true;
        } catch (Exception e) {
            log.debug("后台批量WorkDb表修改失败");
            throw new ServiceException("后台WorkDb表批量修改失败", e);
        }
    }
    // 修改一个后台WorkDb表Selective

    public boolean updateByMapSelective(WorkDb workDb, Map workDbMap) {
        try {
            workDbMapper.updateByExampleSelective(workDb, createWorkDbExample(workDbMap, null, null));
            log.debug("后台批量WorkDb表修改成功");
            return true;
        } catch (Exception e) {
            log.debug("后台批量WorkDb表修改失败");
            throw new ServiceException("后台WorkDb表批量修改失败", e);
        }
    }

    // 查询一个后台WorkDb表

    public WorkDb selectByPrimaryKey(Long id) {
        return workDbMapper.selectByPrimaryKey(id);
    }

    // 查询一个后台WorkDb表-根据map

    public WorkDb selectByMap(Map workDbMap) {
        List<WorkDb> list = getListByMap(workDbMap);
        if (list == null || list.isEmpty()) {
            return null;
        } else {
            return list.get(0);
        }
    }

    ////////////////////////////////////////////////////////////////////////////////////////////////////////
    // 查询所有后台WorkDb表

    public List<WorkDb> getListByMap(Map workDbMap) {

        return workDbMapper.selectByExample(createWorkDbExample(workDbMap, null, null));
    }

    //统计后台WorkDb表数量

    public int countTotalByMap(Map workDbMap) {

        return workDbMapper.countByExample(createWorkDbExample(workDbMap, null, null));
    }


    public List<WorkDb> getListByMapPage(Map workDbMap, int limitStart,
                                         int limitOffset) {

        return workDbMapper.selectByExample(createWorkDbExample(workDbMap, limitStart, limitOffset));
    }


    public PageBean getPageBeanByMap(Map workDbMap, int pageNo, int pageSize) {
        Integer count = countTotalByMap(workDbMap);
        PageBean pageBean = new PageBean();
        pageBean.setCount(count);
        pageBean.setPageNo(pageNo);
        pageBean.setPageSize(pageSize);
        int limitStart = pageBean.getStartNo();
        int limitOffset = pageSize;
        pageBean.setData(workDbMapper.selectByExample(createWorkDbExample(workDbMap, limitStart, limitOffset)));
        return pageBean;
    }

    private WorkDbExample createWorkDbExample(Map workDbMap, Integer limitStart, Integer limitOffset) {
        WorkDbExample workDbEx = new WorkDbExample();
        WorkDbExample.Criteria c = workDbEx.createCriteria();
        Long id_null = TypeCast.getLong(workDbMap.get("id_null"));
        Long id_notNull = TypeCast.getLong(workDbMap.get("id_notNull"));
        Long id = TypeCast.getLong(workDbMap.get("id"));
        Long id_not = TypeCast.getLong(workDbMap.get("id_not"));
        Long id_greater = TypeCast.getLong(workDbMap.get("id_greater"));
        Long id_greaterEqual = TypeCast.getLong(workDbMap.get("id_greaterEqual"));
        Long id_less = TypeCast.getLong(workDbMap.get("id_less"));
        Long id_lessEqual = TypeCast.getLong(workDbMap.get("id_lessEqual"));
        List<Long> id_in = TypeCast.getLongList(workDbMap.get("id_in"));
        List<Long> id_notIn = TypeCast.getLongList(workDbMap.get("id_notIn"));
        Long id_between1 = TypeCast.getLong(workDbMap.get("id_between1"));
        Long id_between2 = TypeCast.getLong(workDbMap.get("id_between2"));
        Long id_notBetween1 = TypeCast.getLong(workDbMap.get("id_notBetween1"));
        Long id_notBetween2 = TypeCast.getLong(workDbMap.get("id_notBetween2"));

        if (id_null != null) {
            c.andIdIsNull();
        }
        if (id_notNull != null) {
            c.andIdIsNotNull();
        }
        if (id != null) {
            c.andIdEqualTo(id);
        }
        if (id_not != null) {
            c.andIdNotEqualTo(id_not);
        }
        if (id_greater != null) {
            c.andIdGreaterThan(id_greater);
        }
        if (id_greaterEqual != null) {
            c.andIdGreaterThanOrEqualTo(id_greaterEqual);
        }
        if (id_less != null) {
            c.andIdLessThan(id_less);
        }
        if (id_lessEqual != null) {
            c.andIdLessThanOrEqualTo(id_lessEqual);
        }
        if (id_in != null) {
            c.andIdIn(id_in);
        }
        if (id_notIn != null) {
            c.andIdNotIn(id_notIn);
        }
        if (id_between1 != null) {
            c.andIdBetween(id_between1, id_between2);
        }
        if (id_notBetween1 != null) {
            c.andIdNotBetween(id_notBetween1, id_notBetween2);
        }
        String dbKey_null = TypeCast.getString(workDbMap.get("dbKey_null"));
        String dbKey_notNull = TypeCast.getString(workDbMap.get("dbKey_notNull"));
        String dbKey = TypeCast.getString(workDbMap.get("dbKey"));
        String dbKey_not = TypeCast.getString(workDbMap.get("dbKey_not"));
        String dbKey_greater = TypeCast.getString(workDbMap.get("dbKey_greater"));
        String dbKey_greaterEqual = TypeCast.getString(workDbMap.get("dbKey_greaterEqual"));
        String dbKey_less = TypeCast.getString(workDbMap.get("dbKey_less"));
        String dbKey_lessEqual = TypeCast.getString(workDbMap.get("dbKey_lessEqual"));
        String dbKey_like = TypeCast.getString(workDbMap.get("dbKey_like"));
        String dbKey_notLike = TypeCast.getString(workDbMap.get("dbKey_notLike"));
        List<String> dbKey_in = TypeCast.getStringList(workDbMap.get("dbKey_in"));
        List<String> dbKey_notIn = TypeCast.getStringList(workDbMap.get("dbKey_notIn"));
        String dbKey_between1 = TypeCast.getString(workDbMap.get("dbKey_between1"));
        String dbKey_between2 = TypeCast.getString(workDbMap.get("dbKey_between2"));
        String dbKey_notBetween1 = TypeCast.getString(workDbMap.get("dbKey_notBetween1"));
        String dbKey_notBetween2 = TypeCast.getString(workDbMap.get("dbKey_notBetween2"));

        if (dbKey_null != null) {
            c.andDbKeyIsNull();
        }
        if (dbKey_notNull != null) {
            c.andDbKeyIsNotNull();
        }
        if (dbKey != null) {
            c.andDbKeyEqualTo(dbKey);
        }
        if (dbKey_not != null) {
            c.andDbKeyNotEqualTo(dbKey_not);
        }
        if (dbKey_greater != null) {
            c.andDbKeyGreaterThan(dbKey_greater);
        }
        if (dbKey_greaterEqual != null) {
            c.andDbKeyGreaterThanOrEqualTo(dbKey_greaterEqual);
        }
        if (dbKey_less != null) {
            c.andDbKeyLessThan(dbKey_less);
        }
        if (dbKey_lessEqual != null) {
            c.andDbKeyLessThanOrEqualTo(dbKey_lessEqual);
        }
        if (dbKey_like != null) {
            c.andDbKeyLike(dbKey_like);
        }
        if (dbKey_notLike != null) {
            c.andDbKeyNotLike(dbKey_notLike);
        }
        if (dbKey_in != null) {
            c.andDbKeyIn(dbKey_in);
        }
        if (dbKey_notIn != null) {
            c.andDbKeyNotIn(dbKey_notIn);
        }
        if (dbKey_between1 != null) {
            c.andDbKeyBetween(dbKey_between1, dbKey_between2);
        }
        if (dbKey_notBetween1 != null) {
            c.andDbKeyNotBetween(dbKey_notBetween1, dbKey_notBetween2);
        }
        String name_null = TypeCast.getString(workDbMap.get("name_null"));
        String name_notNull = TypeCast.getString(workDbMap.get("name_notNull"));
        String name = TypeCast.getString(workDbMap.get("name"));
        String name_not = TypeCast.getString(workDbMap.get("name_not"));
        String name_greater = TypeCast.getString(workDbMap.get("name_greater"));
        String name_greaterEqual = TypeCast.getString(workDbMap.get("name_greaterEqual"));
        String name_less = TypeCast.getString(workDbMap.get("name_less"));
        String name_lessEqual = TypeCast.getString(workDbMap.get("name_lessEqual"));
        String name_like = TypeCast.getString(workDbMap.get("name_like"));
        String name_notLike = TypeCast.getString(workDbMap.get("name_notLike"));
        List<String> name_in = TypeCast.getStringList(workDbMap.get("name_in"));
        List<String> name_notIn = TypeCast.getStringList(workDbMap.get("name_notIn"));
        String name_between1 = TypeCast.getString(workDbMap.get("name_between1"));
        String name_between2 = TypeCast.getString(workDbMap.get("name_between2"));
        String name_notBetween1 = TypeCast.getString(workDbMap.get("name_notBetween1"));
        String name_notBetween2 = TypeCast.getString(workDbMap.get("name_notBetween2"));

        if (name_null != null) {
            c.andNameIsNull();
        }
        if (name_notNull != null) {
            c.andNameIsNotNull();
        }
        if (name != null) {
            c.andNameEqualTo(name);
        }
        if (name_not != null) {
            c.andNameNotEqualTo(name_not);
        }
        if (name_greater != null) {
            c.andNameGreaterThan(name_greater);
        }
        if (name_greaterEqual != null) {
            c.andNameGreaterThanOrEqualTo(name_greaterEqual);
        }
        if (name_less != null) {
            c.andNameLessThan(name_less);
        }
        if (name_lessEqual != null) {
            c.andNameLessThanOrEqualTo(name_lessEqual);
        }
        if (name_like != null) {
            c.andNameLike(name_like);
        }
        if (name_notLike != null) {
            c.andNameNotLike(name_notLike);
        }
        if (name_in != null) {
            c.andNameIn(name_in);
        }
        if (name_notIn != null) {
            c.andNameNotIn(name_notIn);
        }
        if (name_between1 != null) {
            c.andNameBetween(name_between1, name_between2);
        }
        if (name_notBetween1 != null) {
            c.andNameNotBetween(name_notBetween1, name_notBetween2);
        }
        String dbType_null = TypeCast.getString(workDbMap.get("dbType_null"));
        String dbType_notNull = TypeCast.getString(workDbMap.get("dbType_notNull"));
        String dbType = TypeCast.getString(workDbMap.get("dbType"));
        String dbType_not = TypeCast.getString(workDbMap.get("dbType_not"));
        String dbType_greater = TypeCast.getString(workDbMap.get("dbType_greater"));
        String dbType_greaterEqual = TypeCast.getString(workDbMap.get("dbType_greaterEqual"));
        String dbType_less = TypeCast.getString(workDbMap.get("dbType_less"));
        String dbType_lessEqual = TypeCast.getString(workDbMap.get("dbType_lessEqual"));
        String dbType_like = TypeCast.getString(workDbMap.get("dbType_like"));
        String dbType_notLike = TypeCast.getString(workDbMap.get("dbType_notLike"));
        List<String> dbType_in = TypeCast.getStringList(workDbMap.get("dbType_in"));
        List<String> dbType_notIn = TypeCast.getStringList(workDbMap.get("dbType_notIn"));
        String dbType_between1 = TypeCast.getString(workDbMap.get("dbType_between1"));
        String dbType_between2 = TypeCast.getString(workDbMap.get("dbType_between2"));
        String dbType_notBetween1 = TypeCast.getString(workDbMap.get("dbType_notBetween1"));
        String dbType_notBetween2 = TypeCast.getString(workDbMap.get("dbType_notBetween2"));

        if (dbType_null != null) {
            c.andDbTypeIsNull();
        }
        if (dbType_notNull != null) {
            c.andDbTypeIsNotNull();
        }
        if (dbType != null) {
            c.andDbTypeEqualTo(dbType);
        }
        if (dbType_not != null) {
            c.andDbTypeNotEqualTo(dbType_not);
        }
        if (dbType_greater != null) {
            c.andDbTypeGreaterThan(dbType_greater);
        }
        if (dbType_greaterEqual != null) {
            c.andDbTypeGreaterThanOrEqualTo(dbType_greaterEqual);
        }
        if (dbType_less != null) {
            c.andDbTypeLessThan(dbType_less);
        }
        if (dbType_lessEqual != null) {
            c.andDbTypeLessThanOrEqualTo(dbType_lessEqual);
        }
        if (dbType_like != null) {
            c.andDbTypeLike(dbType_like);
        }
        if (dbType_notLike != null) {
            c.andDbTypeNotLike(dbType_notLike);
        }
        if (dbType_in != null) {
            c.andDbTypeIn(dbType_in);
        }
        if (dbType_notIn != null) {
            c.andDbTypeNotIn(dbType_notIn);
        }
        if (dbType_between1 != null) {
            c.andDbTypeBetween(dbType_between1, dbType_between2);
        }
        if (dbType_notBetween1 != null) {
            c.andDbTypeNotBetween(dbType_notBetween1, dbType_notBetween2);
        }
        String driverClass_null = TypeCast.getString(workDbMap.get("driverClass_null"));
        String driverClass_notNull = TypeCast.getString(workDbMap.get("driverClass_notNull"));
        String driverClass = TypeCast.getString(workDbMap.get("driverClass"));
        String driverClass_not = TypeCast.getString(workDbMap.get("driverClass_not"));
        String driverClass_greater = TypeCast.getString(workDbMap.get("driverClass_greater"));
        String driverClass_greaterEqual = TypeCast.getString(workDbMap.get("driverClass_greaterEqual"));
        String driverClass_less = TypeCast.getString(workDbMap.get("driverClass_less"));
        String driverClass_lessEqual = TypeCast.getString(workDbMap.get("driverClass_lessEqual"));
        String driverClass_like = TypeCast.getString(workDbMap.get("driverClass_like"));
        String driverClass_notLike = TypeCast.getString(workDbMap.get("driverClass_notLike"));
        List<String> driverClass_in = TypeCast.getStringList(workDbMap.get("driverClass_in"));
        List<String> driverClass_notIn = TypeCast.getStringList(workDbMap.get("driverClass_notIn"));
        String driverClass_between1 = TypeCast.getString(workDbMap.get("driverClass_between1"));
        String driverClass_between2 = TypeCast.getString(workDbMap.get("driverClass_between2"));
        String driverClass_notBetween1 = TypeCast.getString(workDbMap.get("driverClass_notBetween1"));
        String driverClass_notBetween2 = TypeCast.getString(workDbMap.get("driverClass_notBetween2"));

        if (driverClass_null != null) {
            c.andDriverClassIsNull();
        }
        if (driverClass_notNull != null) {
            c.andDriverClassIsNotNull();
        }
        if (driverClass != null) {
            c.andDriverClassEqualTo(driverClass);
        }
        if (driverClass_not != null) {
            c.andDriverClassNotEqualTo(driverClass_not);
        }
        if (driverClass_greater != null) {
            c.andDriverClassGreaterThan(driverClass_greater);
        }
        if (driverClass_greaterEqual != null) {
            c.andDriverClassGreaterThanOrEqualTo(driverClass_greaterEqual);
        }
        if (driverClass_less != null) {
            c.andDriverClassLessThan(driverClass_less);
        }
        if (driverClass_lessEqual != null) {
            c.andDriverClassLessThanOrEqualTo(driverClass_lessEqual);
        }
        if (driverClass_like != null) {
            c.andDriverClassLike(driverClass_like);
        }
        if (driverClass_notLike != null) {
            c.andDriverClassNotLike(driverClass_notLike);
        }
        if (driverClass_in != null) {
            c.andDriverClassIn(driverClass_in);
        }
        if (driverClass_notIn != null) {
            c.andDriverClassNotIn(driverClass_notIn);
        }
        if (driverClass_between1 != null) {
            c.andDriverClassBetween(driverClass_between1, driverClass_between2);
        }
        if (driverClass_notBetween1 != null) {
            c.andDriverClassNotBetween(driverClass_notBetween1, driverClass_notBetween2);
        }
        String poolType_null = TypeCast.getString(workDbMap.get("poolType_null"));
        String poolType_notNull = TypeCast.getString(workDbMap.get("poolType_notNull"));
        String poolType = TypeCast.getString(workDbMap.get("poolType"));
        String poolType_not = TypeCast.getString(workDbMap.get("poolType_not"));
        String poolType_greater = TypeCast.getString(workDbMap.get("poolType_greater"));
        String poolType_greaterEqual = TypeCast.getString(workDbMap.get("poolType_greaterEqual"));
        String poolType_less = TypeCast.getString(workDbMap.get("poolType_less"));
        String poolType_lessEqual = TypeCast.getString(workDbMap.get("poolType_lessEqual"));
        String poolType_like = TypeCast.getString(workDbMap.get("poolType_like"));
        String poolType_notLike = TypeCast.getString(workDbMap.get("poolType_notLike"));
        List<String> poolType_in = TypeCast.getStringList(workDbMap.get("poolType_in"));
        List<String> poolType_notIn = TypeCast.getStringList(workDbMap.get("poolType_notIn"));
        String poolType_between1 = TypeCast.getString(workDbMap.get("poolType_between1"));
        String poolType_between2 = TypeCast.getString(workDbMap.get("poolType_between2"));
        String poolType_notBetween1 = TypeCast.getString(workDbMap.get("poolType_notBetween1"));
        String poolType_notBetween2 = TypeCast.getString(workDbMap.get("poolType_notBetween2"));

        if (poolType_null != null) {
            c.andPoolTypeIsNull();
        }
        if (poolType_notNull != null) {
            c.andPoolTypeIsNotNull();
        }
        if (poolType != null) {
            c.andPoolTypeEqualTo(poolType);
        }
        if (poolType_not != null) {
            c.andPoolTypeNotEqualTo(poolType_not);
        }
        if (poolType_greater != null) {
            c.andPoolTypeGreaterThan(poolType_greater);
        }
        if (poolType_greaterEqual != null) {
            c.andPoolTypeGreaterThanOrEqualTo(poolType_greaterEqual);
        }
        if (poolType_less != null) {
            c.andPoolTypeLessThan(poolType_less);
        }
        if (poolType_lessEqual != null) {
            c.andPoolTypeLessThanOrEqualTo(poolType_lessEqual);
        }
        if (poolType_like != null) {
            c.andPoolTypeLike(poolType_like);
        }
        if (poolType_notLike != null) {
            c.andPoolTypeNotLike(poolType_notLike);
        }
        if (poolType_in != null) {
            c.andPoolTypeIn(poolType_in);
        }
        if (poolType_notIn != null) {
            c.andPoolTypeNotIn(poolType_notIn);
        }
        if (poolType_between1 != null) {
            c.andPoolTypeBetween(poolType_between1, poolType_between2);
        }
        if (poolType_notBetween1 != null) {
            c.andPoolTypeNotBetween(poolType_notBetween1, poolType_notBetween2);
        }
        String poolOptions_null = TypeCast.getString(workDbMap.get("poolOptions_null"));
        String poolOptions_notNull = TypeCast.getString(workDbMap.get("poolOptions_notNull"));
        String poolOptions = TypeCast.getString(workDbMap.get("poolOptions"));
        String poolOptions_not = TypeCast.getString(workDbMap.get("poolOptions_not"));
        String poolOptions_greater = TypeCast.getString(workDbMap.get("poolOptions_greater"));
        String poolOptions_greaterEqual = TypeCast.getString(workDbMap.get("poolOptions_greaterEqual"));
        String poolOptions_less = TypeCast.getString(workDbMap.get("poolOptions_less"));
        String poolOptions_lessEqual = TypeCast.getString(workDbMap.get("poolOptions_lessEqual"));
        String poolOptions_like = TypeCast.getString(workDbMap.get("poolOptions_like"));
        String poolOptions_notLike = TypeCast.getString(workDbMap.get("poolOptions_notLike"));
        List<String> poolOptions_in = TypeCast.getStringList(workDbMap.get("poolOptions_in"));
        List<String> poolOptions_notIn = TypeCast.getStringList(workDbMap.get("poolOptions_notIn"));
        String poolOptions_between1 = TypeCast.getString(workDbMap.get("poolOptions_between1"));
        String poolOptions_between2 = TypeCast.getString(workDbMap.get("poolOptions_between2"));
        String poolOptions_notBetween1 = TypeCast.getString(workDbMap.get("poolOptions_notBetween1"));
        String poolOptions_notBetween2 = TypeCast.getString(workDbMap.get("poolOptions_notBetween2"));

        if (poolOptions_null != null) {
            c.andPoolOptionsIsNull();
        }
        if (poolOptions_notNull != null) {
            c.andPoolOptionsIsNotNull();
        }
        if (poolOptions != null) {
            c.andPoolOptionsEqualTo(poolOptions);
        }
        if (poolOptions_not != null) {
            c.andPoolOptionsNotEqualTo(poolOptions_not);
        }
        if (poolOptions_greater != null) {
            c.andPoolOptionsGreaterThan(poolOptions_greater);
        }
        if (poolOptions_greaterEqual != null) {
            c.andPoolOptionsGreaterThanOrEqualTo(poolOptions_greaterEqual);
        }
        if (poolOptions_less != null) {
            c.andPoolOptionsLessThan(poolOptions_less);
        }
        if (poolOptions_lessEqual != null) {
            c.andPoolOptionsLessThanOrEqualTo(poolOptions_lessEqual);
        }
        if (poolOptions_like != null) {
            c.andPoolOptionsLike(poolOptions_like);
        }
        if (poolOptions_notLike != null) {
            c.andPoolOptionsNotLike(poolOptions_notLike);
        }
        if (poolOptions_in != null) {
            c.andPoolOptionsIn(poolOptions_in);
        }
        if (poolOptions_notIn != null) {
            c.andPoolOptionsNotIn(poolOptions_notIn);
        }
        if (poolOptions_between1 != null) {
            c.andPoolOptionsBetween(poolOptions_between1, poolOptions_between2);
        }
        if (poolOptions_notBetween1 != null) {
            c.andPoolOptionsNotBetween(poolOptions_notBetween1, poolOptions_notBetween2);
        }
        String dbUrl_null = TypeCast.getString(workDbMap.get("dbUrl_null"));
        String dbUrl_notNull = TypeCast.getString(workDbMap.get("dbUrl_notNull"));
        String dbUrl = TypeCast.getString(workDbMap.get("dbUrl"));
        String dbUrl_not = TypeCast.getString(workDbMap.get("dbUrl_not"));
        String dbUrl_greater = TypeCast.getString(workDbMap.get("dbUrl_greater"));
        String dbUrl_greaterEqual = TypeCast.getString(workDbMap.get("dbUrl_greaterEqual"));
        String dbUrl_less = TypeCast.getString(workDbMap.get("dbUrl_less"));
        String dbUrl_lessEqual = TypeCast.getString(workDbMap.get("dbUrl_lessEqual"));
        String dbUrl_like = TypeCast.getString(workDbMap.get("dbUrl_like"));
        String dbUrl_notLike = TypeCast.getString(workDbMap.get("dbUrl_notLike"));
        List<String> dbUrl_in = TypeCast.getStringList(workDbMap.get("dbUrl_in"));
        List<String> dbUrl_notIn = TypeCast.getStringList(workDbMap.get("dbUrl_notIn"));
        String dbUrl_between1 = TypeCast.getString(workDbMap.get("dbUrl_between1"));
        String dbUrl_between2 = TypeCast.getString(workDbMap.get("dbUrl_between2"));
        String dbUrl_notBetween1 = TypeCast.getString(workDbMap.get("dbUrl_notBetween1"));
        String dbUrl_notBetween2 = TypeCast.getString(workDbMap.get("dbUrl_notBetween2"));

        if (dbUrl_null != null) {
            c.andDbUrlIsNull();
        }
        if (dbUrl_notNull != null) {
            c.andDbUrlIsNotNull();
        }
        if (dbUrl != null) {
            c.andDbUrlEqualTo(dbUrl);
        }
        if (dbUrl_not != null) {
            c.andDbUrlNotEqualTo(dbUrl_not);
        }
        if (dbUrl_greater != null) {
            c.andDbUrlGreaterThan(dbUrl_greater);
        }
        if (dbUrl_greaterEqual != null) {
            c.andDbUrlGreaterThanOrEqualTo(dbUrl_greaterEqual);
        }
        if (dbUrl_less != null) {
            c.andDbUrlLessThan(dbUrl_less);
        }
        if (dbUrl_lessEqual != null) {
            c.andDbUrlLessThanOrEqualTo(dbUrl_lessEqual);
        }
        if (dbUrl_like != null) {
            c.andDbUrlLike(dbUrl_like);
        }
        if (dbUrl_notLike != null) {
            c.andDbUrlNotLike(dbUrl_notLike);
        }
        if (dbUrl_in != null) {
            c.andDbUrlIn(dbUrl_in);
        }
        if (dbUrl_notIn != null) {
            c.andDbUrlNotIn(dbUrl_notIn);
        }
        if (dbUrl_between1 != null) {
            c.andDbUrlBetween(dbUrl_between1, dbUrl_between2);
        }
        if (dbUrl_notBetween1 != null) {
            c.andDbUrlNotBetween(dbUrl_notBetween1, dbUrl_notBetween2);
        }
        String dbName_null = TypeCast.getString(workDbMap.get("dbName_null"));
        String dbName_notNull = TypeCast.getString(workDbMap.get("dbName_notNull"));
        String dbName = TypeCast.getString(workDbMap.get("dbName"));
        String dbName_not = TypeCast.getString(workDbMap.get("dbName_not"));
        String dbName_greater = TypeCast.getString(workDbMap.get("dbName_greater"));
        String dbName_greaterEqual = TypeCast.getString(workDbMap.get("dbName_greaterEqual"));
        String dbName_less = TypeCast.getString(workDbMap.get("dbName_less"));
        String dbName_lessEqual = TypeCast.getString(workDbMap.get("dbName_lessEqual"));
        String dbName_like = TypeCast.getString(workDbMap.get("dbName_like"));
        String dbName_notLike = TypeCast.getString(workDbMap.get("dbName_notLike"));
        List<String> dbName_in = TypeCast.getStringList(workDbMap.get("dbName_in"));
        List<String> dbName_notIn = TypeCast.getStringList(workDbMap.get("dbName_notIn"));
        String dbName_between1 = TypeCast.getString(workDbMap.get("dbName_between1"));
        String dbName_between2 = TypeCast.getString(workDbMap.get("dbName_between2"));
        String dbName_notBetween1 = TypeCast.getString(workDbMap.get("dbName_notBetween1"));
        String dbName_notBetween2 = TypeCast.getString(workDbMap.get("dbName_notBetween2"));

        if (dbName_null != null) {
            c.andDbNameIsNull();
        }
        if (dbName_notNull != null) {
            c.andDbNameIsNotNull();
        }
        if (dbName != null) {
            c.andDbNameEqualTo(dbName);
        }
        if (dbName_not != null) {
            c.andDbNameNotEqualTo(dbName_not);
        }
        if (dbName_greater != null) {
            c.andDbNameGreaterThan(dbName_greater);
        }
        if (dbName_greaterEqual != null) {
            c.andDbNameGreaterThanOrEqualTo(dbName_greaterEqual);
        }
        if (dbName_less != null) {
            c.andDbNameLessThan(dbName_less);
        }
        if (dbName_lessEqual != null) {
            c.andDbNameLessThanOrEqualTo(dbName_lessEqual);
        }
        if (dbName_like != null) {
            c.andDbNameLike(dbName_like);
        }
        if (dbName_notLike != null) {
            c.andDbNameNotLike(dbName_notLike);
        }
        if (dbName_in != null) {
            c.andDbNameIn(dbName_in);
        }
        if (dbName_notIn != null) {
            c.andDbNameNotIn(dbName_notIn);
        }
        if (dbName_between1 != null) {
            c.andDbNameBetween(dbName_between1, dbName_between2);
        }
        if (dbName_notBetween1 != null) {
            c.andDbNameNotBetween(dbName_notBetween1, dbName_notBetween2);
        }
        String dbUser_null = TypeCast.getString(workDbMap.get("dbUser_null"));
        String dbUser_notNull = TypeCast.getString(workDbMap.get("dbUser_notNull"));
        String dbUser = TypeCast.getString(workDbMap.get("dbUser"));
        String dbUser_not = TypeCast.getString(workDbMap.get("dbUser_not"));
        String dbUser_greater = TypeCast.getString(workDbMap.get("dbUser_greater"));
        String dbUser_greaterEqual = TypeCast.getString(workDbMap.get("dbUser_greaterEqual"));
        String dbUser_less = TypeCast.getString(workDbMap.get("dbUser_less"));
        String dbUser_lessEqual = TypeCast.getString(workDbMap.get("dbUser_lessEqual"));
        String dbUser_like = TypeCast.getString(workDbMap.get("dbUser_like"));
        String dbUser_notLike = TypeCast.getString(workDbMap.get("dbUser_notLike"));
        List<String> dbUser_in = TypeCast.getStringList(workDbMap.get("dbUser_in"));
        List<String> dbUser_notIn = TypeCast.getStringList(workDbMap.get("dbUser_notIn"));
        String dbUser_between1 = TypeCast.getString(workDbMap.get("dbUser_between1"));
        String dbUser_between2 = TypeCast.getString(workDbMap.get("dbUser_between2"));
        String dbUser_notBetween1 = TypeCast.getString(workDbMap.get("dbUser_notBetween1"));
        String dbUser_notBetween2 = TypeCast.getString(workDbMap.get("dbUser_notBetween2"));

        if (dbUser_null != null) {
            c.andDbUserIsNull();
        }
        if (dbUser_notNull != null) {
            c.andDbUserIsNotNull();
        }
        if (dbUser != null) {
            c.andDbUserEqualTo(dbUser);
        }
        if (dbUser_not != null) {
            c.andDbUserNotEqualTo(dbUser_not);
        }
        if (dbUser_greater != null) {
            c.andDbUserGreaterThan(dbUser_greater);
        }
        if (dbUser_greaterEqual != null) {
            c.andDbUserGreaterThanOrEqualTo(dbUser_greaterEqual);
        }
        if (dbUser_less != null) {
            c.andDbUserLessThan(dbUser_less);
        }
        if (dbUser_lessEqual != null) {
            c.andDbUserLessThanOrEqualTo(dbUser_lessEqual);
        }
        if (dbUser_like != null) {
            c.andDbUserLike(dbUser_like);
        }
        if (dbUser_notLike != null) {
            c.andDbUserNotLike(dbUser_notLike);
        }
        if (dbUser_in != null) {
            c.andDbUserIn(dbUser_in);
        }
        if (dbUser_notIn != null) {
            c.andDbUserNotIn(dbUser_notIn);
        }
        if (dbUser_between1 != null) {
            c.andDbUserBetween(dbUser_between1, dbUser_between2);
        }
        if (dbUser_notBetween1 != null) {
            c.andDbUserNotBetween(dbUser_notBetween1, dbUser_notBetween2);
        }
        String dbPassword_null = TypeCast.getString(workDbMap.get("dbPassword_null"));
        String dbPassword_notNull = TypeCast.getString(workDbMap.get("dbPassword_notNull"));
        String dbPassword = TypeCast.getString(workDbMap.get("dbPassword"));
        String dbPassword_not = TypeCast.getString(workDbMap.get("dbPassword_not"));
        String dbPassword_greater = TypeCast.getString(workDbMap.get("dbPassword_greater"));
        String dbPassword_greaterEqual = TypeCast.getString(workDbMap.get("dbPassword_greaterEqual"));
        String dbPassword_less = TypeCast.getString(workDbMap.get("dbPassword_less"));
        String dbPassword_lessEqual = TypeCast.getString(workDbMap.get("dbPassword_lessEqual"));
        String dbPassword_like = TypeCast.getString(workDbMap.get("dbPassword_like"));
        String dbPassword_notLike = TypeCast.getString(workDbMap.get("dbPassword_notLike"));
        List<String> dbPassword_in = TypeCast.getStringList(workDbMap.get("dbPassword_in"));
        List<String> dbPassword_notIn = TypeCast.getStringList(workDbMap.get("dbPassword_notIn"));
        String dbPassword_between1 = TypeCast.getString(workDbMap.get("dbPassword_between1"));
        String dbPassword_between2 = TypeCast.getString(workDbMap.get("dbPassword_between2"));
        String dbPassword_notBetween1 = TypeCast.getString(workDbMap.get("dbPassword_notBetween1"));
        String dbPassword_notBetween2 = TypeCast.getString(workDbMap.get("dbPassword_notBetween2"));

        if (dbPassword_null != null) {
            c.andDbPasswordIsNull();
        }
        if (dbPassword_notNull != null) {
            c.andDbPasswordIsNotNull();
        }
        if (dbPassword != null) {
            c.andDbPasswordEqualTo(dbPassword);
        }
        if (dbPassword_not != null) {
            c.andDbPasswordNotEqualTo(dbPassword_not);
        }
        if (dbPassword_greater != null) {
            c.andDbPasswordGreaterThan(dbPassword_greater);
        }
        if (dbPassword_greaterEqual != null) {
            c.andDbPasswordGreaterThanOrEqualTo(dbPassword_greaterEqual);
        }
        if (dbPassword_less != null) {
            c.andDbPasswordLessThan(dbPassword_less);
        }
        if (dbPassword_lessEqual != null) {
            c.andDbPasswordLessThanOrEqualTo(dbPassword_lessEqual);
        }
        if (dbPassword_like != null) {
            c.andDbPasswordLike(dbPassword_like);
        }
        if (dbPassword_notLike != null) {
            c.andDbPasswordNotLike(dbPassword_notLike);
        }
        if (dbPassword_in != null) {
            c.andDbPasswordIn(dbPassword_in);
        }
        if (dbPassword_notIn != null) {
            c.andDbPasswordNotIn(dbPassword_notIn);
        }
        if (dbPassword_between1 != null) {
            c.andDbPasswordBetween(dbPassword_between1, dbPassword_between2);
        }
        if (dbPassword_notBetween1 != null) {
            c.andDbPasswordNotBetween(dbPassword_notBetween1, dbPassword_notBetween2);
        }
        Date createTime_null = TypeCast.getDate(workDbMap.get("createTime_null"));
        Date createTime_notNull = TypeCast.getDate(workDbMap.get("createTime_notNull"));
        Date createTime = TypeCast.getDate(workDbMap.get("createTime"));
        Date createTime_not = TypeCast.getDate(workDbMap.get("createTime_not"));
        Date createTime_greater = TypeCast.getDate(workDbMap.get("createTime_greater"));
        Date createTime_greaterEqual = TypeCast.getDate(workDbMap.get("createTime_greaterEqual"));
        Date createTime_less = TypeCast.getDate(workDbMap.get("createTime_less"));
        Date createTime_lessEqual = TypeCast.getDate(workDbMap.get("createTime_lessEqual"));
        List<Date> createTime_in = TypeCast.getDateList(workDbMap.get("createTime_in"));
        List<Date> createTime_notIn = TypeCast.getDateList(workDbMap.get("createTime_notIn"));
        Date createTime_between1 = TypeCast.getDate(workDbMap.get("createTime_between1"));
        Date createTime_between2 = TypeCast.getDate(workDbMap.get("createTime_between2"));
        Date createTime_notBetween1 = TypeCast.getDate(workDbMap.get("createTime_notBetween1"));
        Date createTime_notBetween2 = TypeCast.getDate(workDbMap.get("createTime_notBetween2"));

        if (createTime_null != null) {
            c.andCreateTimeIsNull();
        }
        if (createTime_notNull != null) {
            c.andCreateTimeIsNotNull();
        }
        if (createTime != null) {
            c.andCreateTimeEqualTo(createTime);
        }
        if (createTime_not != null) {
            c.andCreateTimeNotEqualTo(createTime_not);
        }
        if (createTime_greater != null) {
            c.andCreateTimeGreaterThan(createTime_greater);
        }
        if (createTime_greaterEqual != null) {
            c.andCreateTimeGreaterThanOrEqualTo(createTime_greaterEqual);
        }
        if (createTime_less != null) {
            c.andCreateTimeLessThan(createTime_less);
        }
        if (createTime_lessEqual != null) {
            c.andCreateTimeLessThanOrEqualTo(createTime_lessEqual);
        }
        if (createTime_in != null) {
            c.andCreateTimeIn(createTime_in);
        }
        if (createTime_notIn != null) {
            c.andCreateTimeNotIn(createTime_notIn);
        }
        if (createTime_between1 != null) {
            c.andCreateTimeBetween(createTime_between1, createTime_between2);
        }
        if (createTime_notBetween1 != null) {
            c.andCreateTimeNotBetween(createTime_notBetween1, createTime_notBetween2);
        }
        Date updateTime_null = TypeCast.getDate(workDbMap.get("updateTime_null"));
        Date updateTime_notNull = TypeCast.getDate(workDbMap.get("updateTime_notNull"));
        Date updateTime = TypeCast.getDate(workDbMap.get("updateTime"));
        Date updateTime_not = TypeCast.getDate(workDbMap.get("updateTime_not"));
        Date updateTime_greater = TypeCast.getDate(workDbMap.get("updateTime_greater"));
        Date updateTime_greaterEqual = TypeCast.getDate(workDbMap.get("updateTime_greaterEqual"));
        Date updateTime_less = TypeCast.getDate(workDbMap.get("updateTime_less"));
        Date updateTime_lessEqual = TypeCast.getDate(workDbMap.get("updateTime_lessEqual"));
        List<Date> updateTime_in = TypeCast.getDateList(workDbMap.get("updateTime_in"));
        List<Date> updateTime_notIn = TypeCast.getDateList(workDbMap.get("updateTime_notIn"));
        Date updateTime_between1 = TypeCast.getDate(workDbMap.get("updateTime_between1"));
        Date updateTime_between2 = TypeCast.getDate(workDbMap.get("updateTime_between2"));
        Date updateTime_notBetween1 = TypeCast.getDate(workDbMap.get("updateTime_notBetween1"));
        Date updateTime_notBetween2 = TypeCast.getDate(workDbMap.get("updateTime_notBetween2"));

        if (updateTime_null != null) {
            c.andUpdateTimeIsNull();
        }
        if (updateTime_notNull != null) {
            c.andUpdateTimeIsNotNull();
        }
        if (updateTime != null) {
            c.andUpdateTimeEqualTo(updateTime);
        }
        if (updateTime_not != null) {
            c.andUpdateTimeNotEqualTo(updateTime_not);
        }
        if (updateTime_greater != null) {
            c.andUpdateTimeGreaterThan(updateTime_greater);
        }
        if (updateTime_greaterEqual != null) {
            c.andUpdateTimeGreaterThanOrEqualTo(updateTime_greaterEqual);
        }
        if (updateTime_less != null) {
            c.andUpdateTimeLessThan(updateTime_less);
        }
        if (updateTime_lessEqual != null) {
            c.andUpdateTimeLessThanOrEqualTo(updateTime_lessEqual);
        }
        if (updateTime_in != null) {
            c.andUpdateTimeIn(updateTime_in);
        }
        if (updateTime_notIn != null) {
            c.andUpdateTimeNotIn(updateTime_notIn);
        }
        if (updateTime_between1 != null) {
            c.andUpdateTimeBetween(updateTime_between1, updateTime_between2);
        }
        if (updateTime_notBetween1 != null) {
            c.andUpdateTimeNotBetween(updateTime_notBetween1, updateTime_notBetween2);
        }
        if (workDbMap.get("orderBy") != null) {
            workDbEx.setOrderByClause((String) workDbMap.get("orderBy"));
        }
        if (limitStart != null && limitOffset != null) {
            workDbEx.setLimitStart(limitStart);
            workDbEx.setLimitOffset(limitOffset);
        }

        return workDbEx;
    }
}
